import request from '@/utils/request'

// 查询菜单列表
export function listMenu(data) {
  return request({
    url: '/rbac/permission/list',
    method: 'post',
    data: data
  })
}

// 查询菜单详细
export function getMenu(data) {
  return request({
    url: '/rbac/permission/detail',
    method: 'post',
    data: data
  })
}

// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId) {
  return request({
    url: '/system/menu/roleMenuTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增菜单
export function addMenu(data) {
  return request({
    url: '/rbac/permission/add',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateMenu(data) {
  return request({
    url: '/rbac/permission/update',
    method: 'post',
    data: data
  })
}

// 删除菜单
export function delMenu(data) {
  return request({
    url: '/rbac/permission/del',
    method: 'post',
    data: data
  })
}

/** 选择停用则路由将不会出现在侧边栏，也不能被访问 */
export const STATUS = {
  1: '显示',
  2: '隐藏'
}
